/**
* <p>Title: BaseAction.java</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2013</p>
* @author majintao
* @date 2013-1-31
* @version 1.0
*/
package action;

/**
 * <p>Title: BaseAction</p>
 * <p>Description: </p>
 * <p>Company: mjt</p>
 * @author  majintao
 * @date   2013-1-31
 */

import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class BaseAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware {

	private static final long serialVersionUID = 7620009925942346125L;
	
	ActionContext context = ActionContext.getContext();
	HttpServletRequest request;
	HttpServletResponse response;
	SessionMap session;
	public void setSession(Map map) {
		this.session = (SessionMap) map;
	}
	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}
	public void setServletResponse(HttpServletResponse response) {
		response.setCharacterEncoding("utf-8");
		response.setContentType("text/plain");
		this.response = response;
	}
	public HttpServletRequest getRequest() {
		return request;
	}
	
	public HttpServletResponse getResponse() {
		return response;
	}

	public SessionMap getSession() {
		return session;
	}
	
}

